package com.sfeir.poc.portal.gui.client.events;
/**
 * 
 * @author martin.d
 *
 */

public class ApplicationEvent {

	/** Event type. */
	private ApplicationEventType type;

	/** A context object related to the event. Can be a parameter used by the listener. */
	private Object context;

	/**
	 * Constructor.
	 */
	public ApplicationEvent() {
	}

	/**
	 * Constructor.
	 * @param type type
	 */
	public ApplicationEvent(final ApplicationEventType type) {
		this(type, null);
	}

	/**
	 * Constructor.
	 * @param type
	 * @param context
	 */
	public ApplicationEvent(final ApplicationEventType type, final Object context) {
		this.type = type;
		this.context = context;
	}

	/**
	 * @return the type of the event
	 */
	public ApplicationEventType getType() {
		return this.type;
	}

	/**
	 * @param type the type to set
	 */
	public void setType(final ApplicationEventType type) {
		this.type = type;
	}

	/**
	 * @return the context
	 */
	public Object getContext() {
		return this.context;
	}

	/**
	 * @param context the context to set
	 */
	public void setContext(final Object context) {
		this.context = context;
	}

	public String toString() {
		return this.type.toString();
	}

}
